﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MUD.Lib.Utils;

namespace MUD.Lib.Objects.Characters
{
    internal class Vitals
    {
        /// <summary>
        /// Health is in a bounded structure. Add to and remove from using the Change() method.
        /// </summary>
        public Bound Health = new Bound();

        /// <summary>
        /// Is the character fully healed?
        /// </summary>
        public bool FullyHealed { get { return Health.Current == Health.Max; } }

        /// <summary>
        /// Is the character incapacitated?
        /// </summary>
        public bool Incapacitated { get { return Health.Current == Health.Min; } }

        /// <summary>
        /// Willpower is in a bounded structure. This measures how much raw will the character can access. 
        /// Willpower is used to boost the chances of success for an action or series of actions. It can be refilled
        /// by succeeding at certain tested actions.
        /// </summary>
        public Bound Willpower = new Bound();

        /// <summary>
        /// How well thought of is the character? This may end up being replaced by a collection of ints based on
        /// faction relationship.
        /// </summary>
        public int Reputation { get; set; }

        public Vitals()
        {
        }

        /// <summary>
        /// Heal the character for the integer amount.
        /// </summary>
        /// <param name="amount">Amount to heal</param>
        public void Heal_Amt(int amount)
        {
            Health.Change(amount);
        }

        /// <summary>
        /// Heal the character for the percentage amount.
        /// </summary>
        /// <param name="pct">Percentage of max health to heal.</param>
        public void Heal_Pct(float pct)
        {
            Health.Change((int)Math.Round(pct * (float)Health.Max, 0));
        }
    }
}
